﻿using ChinaAzureStorageRedirector.Properties;
using System;
using System.IO;
using System.Windows.Forms;

namespace ChinaAzureStorageRedirector
{
    /// <summary>
    /// 
    /// </summary>
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Show the system tray icon.					
            using (ProcessIcon pi = new ProcessIcon())
            {
                pi.Display();

                if (!File.Exists(Helper.RuleFilePath))
                {
                    File.Create(Helper.RuleFilePath);
                    File.WriteAllText(Helper.RuleFilePath, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><ArrayOfString xmlns:" +
                      "xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
                      "</ArrayOfString>");

                }
                // Make sure the application runs!
                Application.Run();
            }
        }
    }
}